<?php
class UpdateController extends PageController{
	public function actionIndex(){

		$dbManager = new DBManager($this->getDb());
		
		$config = new Config();
		$content = $dbManager->createSQLCreateTableDump($config->import(APP . 'config/database.php')->get('database')->get('name'));
// 		$content = $dbManager->createSQLCreateTableDump($dbname);
		file_put_contents(APP."setup.sql.php", $content);

		$updater = new Mvc_Updater($this->getDb());
		$updater->updateAll();
		die();
	}
}